FROM openjdk:8u212-jre
MAINTAINER zengbang 2364962690@qq.com

ENV NACOS_HOST  spring-cloud-discovery.test-project
ENV NACOS_PORT 8848
ENV NACOS_NAMESPACE  fb18e7db9d32
ENV NACOS_GROUP dev
ENV PAAS_NAME  sentinel-zengbang
ENV PAAS_NS test-project
ENV SENTINEL_DASHBOARD_ADDR sentinel-zengbang-dashboard.test-project:8080
ENV SENTINEL_PORT 8888
ENV SENTINEI_IP localhost
ADD cloudalibaba-sentinel-service8401-1.0-SNAPSHOT.jar /app/app.jar
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

WORKDIR "/app"

EXPOSE 8080
CMD ["java", "-Xms256m", "-Xmx1g", \
                 "-XX:+UnlockExperimentalVMOptions", \
                 "-XX:+UseCGroupMemoryLimitForHeap", \
                 "-Dnacos.discovery.host=${NACOS_HOST}", \
                 "-Dnacos.discovery.port=${NACOS_PORT}", \
                 "-Dnacos.discovery.namespace=${NACOS_NAMESPACE}", \
                 "-Dnacos.discovery.group=${NACOS_GROUP}", \
                 "-Dnacos.discovery.service=${PAAS_NAME}", \
                 "-Dpaas.name=${PAAS_NAME}", \
                 "-Dpaas.ns=${PAAS_NS}", \
                 "-Dsentinel.dashboard.addr=${SENTINEL_DASHBOARD_ADDR}", \
                 "-Dsentinel.port=${SENTINEL_PORT}", \
                 "-Dsentinel.ip=${SENTINEI_IP}", \
                 "-jar", "/app/app.jar"]